//
//  PSPaddingTextField.m
//  ZAYY
//
//  Created by Vic on 2019/10/23.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "PSPaddingTextField.h"

@implementation PSPaddingTextField

- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}
- (CGRect)textRectForBounds:(CGRect)bounds {
    return CGRectInset(bounds, self.xPadding, self.yPadding);
}
- (CGRect)editingRectForBounds:(CGRect)bounds {
    return CGRectInset(bounds, self.xPadding, self.yPadding);
}
- (void)setXPadding:(CGFloat)xPadding {
    _xPadding = xPadding;
    [self setNeedsDisplay];
}
- (void)setYPadding:(CGFloat)yPadding {
    _yPadding = yPadding;
    [self setNeedsDisplay];
}

@end
